﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

using System.Text;
using System.Windows.Forms;

namespace SqlMetalBuilder
{
    public partial class Options : Form
    {
        public Options()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            ConfigurationManager.AppSettings["SqlMetalFileLocation"] = txtSqlMetalLocation.Text;
            this.Close();
        }

        private void btnSqlMetalLocationBrowser_Click(object sender, EventArgs e)
        {
            objFileDialog.FileName = "SqlMetal.exe";
            objFileDialog.Filter = "Executable files (*.exe)|*.exe";
            if (objFileDialog.ShowDialog(this) == DialogResult.OK)
                txtSqlMetalLocation.Text = objFileDialog.FileName;

        }

        private void Options_Load(object sender, EventArgs e)
        {
             txtSqlMetalLocation.Text = ConfigurationManager.AppSettings["SqlMetalFileLocation"];
        }

    }
}
